<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>盒子的浮动</title>
  <style>
    *{
      padding:0;
      margin: 0;
    }
    ul {
      list-style: none;
      background-color: #f54343;
    }
    li {
      float:left;
      color: white;
      width: 100px;
      padding: 10px 10px;
      text-align: center;
    }
    li:hover{
      background-color: #f76969;
      cursor: pointer;
    }
    .first{
      margin-left: 50px;
    }
    /*解决浮动塌陷*/
    .clearfix:after{content:'\20';display:block;height:0;clear:both}
    .clearfix{zoom:1}
  </style>
</head>
<body>
<ul class="clearfix">
  <li class="first">资讯</li>
  <li>财经</li>
  <li>科技</li>
  <li>凤凰卫视</li>
  <li>娱乐</li>
  <li>时尚</li>
  <li>军事</li>
  <li>体育</li>
</ul>
</body>
</html>
